<template>
	<div>
		<el-tabs v-model="activeName"  @tab-click="handleClick">
			<el-tab-pane label="供应商管理" name="first">
				<Supplier ref="SupplierRef"></Supplier>
		    </el-tab-pane>
			<el-tab-pane label="仓库管理" name="second">
				<WareHouse ref="WareHouseRef"></WareHouse>
			</el-tab-pane>
			<el-tab-pane label="原料管理" name="third">
				<RawMeterial ref="RawMeterialRef"></RawMeterial>
			</el-tab-pane>
		</el-tabs>
	</div>
</template>

<script>
	import Supplier from './tstoresupplier.vue'
	import WareHouse from './tstorewarehouse.vue'
	import RawMeterial from './tfactoryrawmeterialtype.vue'
	export default{
		components:{
			Supplier,
			WareHouse,
			RawMeterial
		},
		
		data(){
			return{
				activeName:'first'
			}
		},
		
		created() {
			this.$refs.SupplierRef.getDataList()
		},
		
		methods:{
			handleClick(tab,event){
				if(tab.name === 'first'){
					this.$refs.SupplierRef.getDataList()
				}
				else if(tab.name === 'second'){
					this.$refs.WareHouseRef.getDataList()
				}
				else{
					this.$refs.RawMeterialRef.getDataList()
				}
			}
		}
		
	}
</script>

<style>
</style>
